package com.softeem.musicserver.controller;

import com.softeem.musicserver.dto.R;
import com.softeem.musicserver.entity.Ablum;
import com.softeem.musicserver.service.AblumService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "专辑管理",description = "专辑相关管理功能，包含：添加，修改，删除，检索等")
@CrossOrigin
@RestController
public class AblumController {

    @Autowired
    private AblumService ablumService;

    @Operation(summary = "查询所有专辑",description = "所有专辑查询，用于上传歌曲时，选择关联的专辑")
    @GetMapping("/ablum/listAll")
    public R queryAll(){
        List<Ablum> list = ablumService.list();
        return R.ok().setMsg("查询成功").setData(list);
    }
}
